<?php
namespace app\shop\model;
/*
 *表名
 */
class SettingModel extends BaseModel
{
    protected $table = 'xst_setting';
    protected $rule = [
        'id' => '',
    ];
    protected $msg = [
        'id' => '',
    ];
    //查询所有数据
    public function AllData(){
        $list=$this->paginate(10);
        $page = $list->render();
        $arr=[$list,$page];
        return $arr;
    }
    //查询单条数据
    public function OneData($id){
        $res=$this->where('id',$id)->find();
        return $res;
    }
    //修改数据
    public function updata($id,$data){
        $res=$this->where('id',$id)->update(['value'=>$data]);
        if ($res)
            $status = ['code'=>1,'msg'=>'修改成功'];
        else
            $status = ['code'=>0,'msg'=>'修改失败'];
        return $status;
    }
}
